package Week3.J0430;

// 注意数据大小 ret 用 long 接收

import java.util.Arrays;
import java.util.Scanner;

public class 组队竞赛_xv {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] arr = new int[3 * n];

        for (int i = 0; i < 3 * n; i++) {
            arr[i] = scanner.nextInt();
        }
        Arrays.sort(arr);

        int pos = n * 3 - 2;
        long ret = 0;

        while (n-- != 0) {
            ret += arr[pos];
            pos -= 2;
        }

        System.out.println(ret);
    }
}
